<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Paperclip::Interpolations</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Paperclip::Interpolations</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/paperclip/lib/paperclip/interpolations_rb.html">
                vendor/plugins/paperclip/lib/paperclip/interpolations.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This module contains <a href="Interpolations.html#M000067">all</a> the
methods that are available for interpolation in paths and urls. To add your
own (or override an existing one), you can either open this module and
define it, or call the <a
href="../Paperclip.html#M000007">Paperclip.interpolates</a> method.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000066">[]</a>&nbsp;&nbsp;
      <a href="#M000065">[]=</a>&nbsp;&nbsp;
      <a href="#M000067">all</a>&nbsp;&nbsp;
      <a href="#M000079">attachment</a>&nbsp;&nbsp;
      <a href="#M000075">basename</a>&nbsp;&nbsp;
      <a href="#M000074">class</a>&nbsp;&nbsp;
      <a href="#M000076">extension</a>&nbsp;&nbsp;
      <a href="#M000069">filename</a>&nbsp;&nbsp;
      <a href="#M000077">id</a>&nbsp;&nbsp;
      <a href="#M000078">id_partition</a>&nbsp;&nbsp;
      <a href="#M000068">interpolate</a>&nbsp;&nbsp;
      <a href="#M000073">rails_env</a>&nbsp;&nbsp;
      <a href="#M000072">rails_root</a>&nbsp;&nbsp;
      <a href="#M000080">style</a>&nbsp;&nbsp;
      <a href="#M000071">timestamp</a>&nbsp;&nbsp;
      <a href="#M000070">url</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000066" class="method-detail">
        <a name="M000066"></a>

        <div class="method-heading">
          <a href="#M000066" class="method-signature">
          <span class="method-name">[]</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Hash access of interpolations. Included only for compatability, and is not
intended for normal use.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000066-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 17</span>
17:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span> <span class="ruby-identifier">name</span>
18:       <span class="ruby-identifier">method</span>(<span class="ruby-identifier">name</span>)
19:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000065" class="method-detail">
        <a name="M000065"></a>

        <div class="method-heading">
          <a href="#M000065" class="method-signature">
          <span class="method-name">[]=</span><span class="method-args">(name, block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Hash assignment of interpolations. Included only for compatability, and is
not intended for normal use.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000065-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 11</span>
11:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]=</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">block</span>
12:       <span class="ruby-identifier">define_method</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
13:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000067" class="method-detail">
        <a name="M000067"></a>

        <div class="method-heading">
          <a href="#M000067" class="method-signature">
          <span class="method-name">all</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a sorted list of <a href="Interpolations.html#M000067">all</a>
interpolations.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000067-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 22</span>
22:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">all</span>
23:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance_methods</span>(<span class="ruby-keyword kw">false</span>).<span class="ruby-identifier">sort</span>
24:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000068" class="method-detail">
        <a name="M000068"></a>

        <div class="method-heading">
          <a href="#M000068" class="method-signature">
          <span class="method-name">interpolate</span><span class="method-args">(pattern, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Perform the actual interpolation. Takes the pattern to <a
href="Interpolations.html#M000068">interpolate</a> and the arguments to
pass, which are the <a href="Interpolations.html#M000079">attachment</a>
and <a href="Interpolations.html#M000080">style</a> name.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000068-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 28</span>
28:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">interpolate</span> <span class="ruby-identifier">pattern</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
29:       <span class="ruby-identifier">all</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">inject</span>( <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">dup</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
30:         <span class="ruby-identifier">result</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/:#{tag}/</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
31:           <span class="ruby-identifier">send</span>( <span class="ruby-identifier">tag</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
32:         <span class="ruby-keyword kw">end</span>
33:       <span class="ruby-keyword kw">end</span>
34:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000079" class="method-detail">
        <a name="M000079"></a>

        <div class="method-heading">
          <a href="#M000079" class="method-signature">
          <span class="method-name">attachment</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the pluralized form of the <a
href="Interpolations.html#M000079">attachment</a> name. e.g.
&quot;avatars&quot; for an <a
href="Interpolations.html#M000079">attachment</a> of :avatar
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000079-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 99</span>
 99:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attachment</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
100:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">pluralize</span>
101:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000075" class="method-detail">
        <a name="M000075"></a>

        <div class="method-heading">
          <a href="#M000075" class="method-signature">
          <span class="method-name">basename</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000075">basename</a> of the file.
e.g. &quot;file&quot; for &quot;file.jpg&quot;
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000075-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 74</span>
74:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">basename</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
75:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">original_filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{File.extname(attachment.original_filename)}$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
76:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000074" class="method-detail">
        <a name="M000074"></a>

        <div class="method-heading">
          <a href="#M000074" class="method-signature">
          <span class="method-name">class</span><span class="method-args">(attachment = nil, style_name = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the underscored, pluralized version of the <a
href="Interpolations.html#M000074">class</a> name. e.g. &quot;users&quot;
for the User <a href="Interpolations.html#M000074">class</a>. NOTE: The
arguments need to be optional, because some tools fetch <a
href="Interpolations.html#M000067">all</a> <a
href="Interpolations.html#M000074">class</a> names. Calling <a
href="Interpolations.html#M000074">class</a> will return the expected <a
href="Interpolations.html#M000074">class</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000074-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 68</span>
68:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">class</span> <span class="ruby-identifier">attachment</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">style_name</span> = <span class="ruby-keyword kw">nil</span>
69:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">super</span>() <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">style_name</span>.<span class="ruby-identifier">nil?</span>
70:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">underscore</span>.<span class="ruby-identifier">pluralize</span>
71:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000076" class="method-detail">
        <a name="M000076"></a>

        <div class="method-heading">
          <a href="#M000076" class="method-signature">
          <span class="method-name">extension</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000076">extension</a> of the
file. e.g. &quot;jpg&quot; for &quot;file.jpg&quot; If the <a
href="Interpolations.html#M000080">style</a> has a format defined, it will
return the format instead of the actual <a
href="Interpolations.html#M000076">extension</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000076-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 81</span>
81:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extension</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span> 
82:       ((<span class="ruby-identifier">style</span> = <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">styles</span>[<span class="ruby-identifier">style_name</span>]) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">style</span>[<span class="ruby-identifier">:format</span>]) <span class="ruby-operator">||</span>
83:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">original_filename</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^\.+/</span>, <span class="ruby-value str">&quot;&quot;</span>)
84:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000069" class="method-detail">
        <a name="M000069"></a>

        <div class="method-heading">
          <a href="#M000069" class="method-signature">
          <span class="method-name">filename</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000069">filename</a>, the same
way as &quot;:<a href="Interpolations.html#M000075">basename</a>.:<a
href="Interpolations.html#M000076">extension</a>&quot; would.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000069-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 37</span>
37:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">filename</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
38:       <span class="ruby-node">&quot;#{basename(attachment, style_name)}.#{extension(attachment, style_name)}&quot;</span>
39:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000077" class="method-detail">
        <a name="M000077"></a>

        <div class="method-heading">
          <a href="#M000077" class="method-signature">
          <span class="method-name">id</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000077">id</a> of the instance.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000077-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 87</span>
87:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">id</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
88:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">id</span>
89:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000078" class="method-detail">
        <a name="M000078"></a>

        <div class="method-heading">
          <a href="#M000078" class="method-signature">
          <span class="method-name">id_partition</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000077">id</a> of the instance in
a split path form. e.g. returns 000/001/234 for an <a
href="Interpolations.html#M000077">id</a> of 1234.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000078-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 93</span>
93:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">id_partition</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
94:       (<span class="ruby-value str">&quot;%09d&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">id</span>).<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/\d{3}/</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/&quot;</span>)
95:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000073" class="method-detail">
        <a name="M000073"></a>

        <div class="method-heading">
          <a href="#M000073" class="method-signature">
          <span class="method-name">rails_env</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the RAILS_ENV constant.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000073-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 60</span>
60:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails_env</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
61:       <span class="ruby-constant">RAILS_ENV</span>
62:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000072" class="method-detail">
        <a name="M000072"></a>

        <div class="method-heading">
          <a href="#M000072" class="method-signature">
          <span class="method-name">rails_root</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the RAILS_ROOT constant.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000072-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 55</span>
55:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails_root</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
56:       <span class="ruby-constant">RAILS_ROOT</span>
57:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000080" class="method-detail">
        <a name="M000080"></a>

        <div class="method-heading">
          <a href="#M000080" class="method-signature">
          <span class="method-name">style</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000080">style</a>, or the default
<a href="Interpolations.html#M000080">style</a> if nil is supplied.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000080-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 104</span>
104:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">style</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
105:       <span class="ruby-identifier">style_name</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">default_style</span>
106:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000071" class="method-detail">
        <a name="M000071"></a>

        <div class="method-heading">
          <a href="#M000071" class="method-signature">
          <span class="method-name">timestamp</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="Interpolations.html#M000071">timestamp</a> as defined
by the &lt;<a
href="Interpolations.html#M000079">attachment</a>&gt;_updated_at field
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000071-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 50</span>
50:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timestamp</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
51:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">instance_read</span>(<span class="ruby-identifier">:updated_at</span>).<span class="ruby-identifier">to_s</span>
52:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000070" class="method-detail">
        <a name="M000070"></a>

        <div class="method-heading">
          <a href="#M000070" class="method-signature">
          <span class="method-name">url</span><span class="method-args">(attachment, style_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the interpolated URL. Will raise an error if the <a
href="Interpolations.html#M000070">url</a> itself contains &quot;:<a
href="Interpolations.html#M000070">url</a>&quot; to prevent infinite
recursion. This interpolation is used in the default :path to ease default
specifications.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000070-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip/interpolations.rb, line 44</span>
44:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url</span> <span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">style_name</span>
45:       <span class="ruby-identifier">raise</span> <span class="ruby-constant">InfiniteInterpolationError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:url</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;:url&quot;</span>)
46:       <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">url</span>(<span class="ruby-identifier">style_name</span>, <span class="ruby-keyword kw">false</span>)
47:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>